<?php
declare (strict_types=1);

namespace app\listener;

use app\common\job\ConsultingEnd;
use app\common\model\Consulting;
use app\common\service\GatewayClientServer;
use app\index\service\MessageSendService;
use think\facade\Queue;

/**
 * 指定律师咨询（找律师）
 * Class DesignateConsultingCreated
 * @version v2.0
 * @package app\listener
 */
class DesignateConsultingCreated
{

    /**
     * 咨询被创建 事件监听处理
     * @return mixed
     */
    public function handle(Consulting $consulting)
    {
        // 24小时后尝试关闭咨询
        $job_data = ['id' => $consulting->id];
        Queue::later(24 * 3600 + 5, ConsultingEnd::class, $job_data);
    }

}
